﻿namespace Engine.Serialization
{
    using System.Web.Script.Serialization;
    using System.Runtime.Serialization.Json;
    using System.IO;
    using System.Xml;

    public class JsonSerializerAdapter<T> : ISerializer<T>
        where T : class
    {
        #region [Attributes]
        private JavaScriptSerializer serializer;
        #endregion

        #region [Methods]
        public JsonSerializerAdapter()
        {
            this.serializer = new JavaScriptSerializer();
        }

        public T Deserialize(string input)
        {
            return this.serializer.Deserialize<T>(input);
        }
        #endregion
    }
}
